<template>
  <div class="slider-move" :class="{ error: typpe === 0, success: type === 1 }">
    <div class="slider-move-track">
      <div class="tianai-captcha-slider-move-track-mask" :style="styleMoveMask"></div>
      <div class="slider-move-shadow"></div>
    </div>
    <slot name="sliderButton">
      <div class="slider-move-btn" :style="styleMoveBtn" @mousedown="onTouchstart" @touchstart="onTouchstart">
        <img class="slider-move-btn-img" :src="imageMovebtn" />
      </div>
    </slot>
  </div>
</template>
<script>
export default {
  props: {
    type: {
      type: Number,
      default: -1, // -1：静止，0:失败,1:成功
    },
  },
  components: {},
  data() {
    return {};
  },
  computed: {},
  methods: {},
  created() {},
  mounted() {},
  beforeUnmount() {},
  watch: {},
};
</script>
<style lang="scss" scoped>
.slider-move {
  height: 34px;
  width: 100%;
  margin: 11px 0;
  position: relative;
  &-track {
    position: relative;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: #f5f5f5;
    color: #999;
    transition: 0s;
    font-size: 14px;
    box-sizing: content-box;
    border: 1px solid #f5f5f5;
    border-radius: 4px;
  }
  &-btn {
    transform: translate(0px, 0px);
    position: absolute;
    top: -6px;
    left: 0;
    width: 63px;
    height: 45px;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: contain;
    border-radius: 5px;
    &-img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  }
}
.refresh-btn,
.close-btn {
  display: inline-block;
}
.slider-move {
  line-height: 38px;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  color: #88949d;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
  filter: opacity(0.8);
}

.slider-tip {
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 15px;
  line-height: normal;
  color: black;
}
.slider-move-btn:hover {
  cursor: pointer;
}

@keyframes myanimation {
  from {
    left: 0;
  }
  to {
    left: 289px;
  }
}
.slider-move-shadow {
  animation: myanimation 2s infinite;
  height: 100%;
  width: 5px;
  background-color: #fff;
  position: absolute;
  top: 0;
  left: 0;
  filter: opacity(0.5);
  box-shadow: 1px 1px 1px #fff;
  border-radius: 50%;
}
.tianai-captcha-slider-move-track-mask {
  border-width: 1px;
  border-style: solid;
  border-color: #00f4ab;

  width: 0;
  height: 32px;
  background-color: #a9ffe5;
  opacity: 0.5;
  position: absolute;
  top: -1px;
  left: -1px;
  border-radius: 5px;
}
</style>
